package com.mnotice.message.receiver;

import com.mnotice.common.entity.message.Notification;
import com.mnotice.message.factory.InformerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class MyListener {
    @Resource
    private InformerFactory informerFactory;

    @RabbitListener(queues = "item_queue")
    public void msg(Notification msg) throws Exception {
        informerFactory.getInformer(msg).inform(msg);
    }
}
